<p>检查子表达式中是否有赋值操作，这种操作会使代码的可读性降低。</p>
<h2>不规范的代码示例</h2>
<pre>
doSomething(i = 42);
</pre>
<h2>正确的解决方案</h2>

<pre>
i = 42;
doSomething(i);   
</pre>
<p>or</p>
<pre>
doSomething(i == 42);  // 运用赋值运算符
</pre>
<h2>例外</h2>

<p>允许在<code> while </code>语句条件中进行赋值，以及关系表达式中包含的赋值。</p>
<h2>更多</h2>

<ul>
<li> MISRA C:2004, 13.1 - Assignment operators shall not be used in expressions that yield a Boolean value</li>
<li> MISRA C++:2008, 6-2-1 - Assignment operators shall not be used in sub-expressions</li>
<li> MISRA C:2012, 13.4 - The result of of an assignment operator should not be used</li>
<li> <a href="http://cwe.mitre.org/data/definitions/481.html">MITRE, CWE-481</a> - Assigning instead of Comparing</li>
</ul>

